﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using com.pro2e.web.util.page;

public partial class whatis02 : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnPrint_Click(object sender, ImageClickEventArgs e)
    {
        string c = GetCheckBox();
        string t = GetTextBox();
      //  OpenNewWin("whatis02print.aspx?c=" + c + "&t=" + t, "該如何準備就診[列印]");
       // LocationHref("whatis02print.aspx?c=" + c + "&t=" + t);
        Server.Transfer("whatis02print.aspx?c=" + c + "&t=" + t);
    }

    private string GetTextBox()
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(txt01.Text +";" +txt02.Text);
        return sb.ToString();
    }

    private string GetCheckBox()
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(Trasfer(ckb00));
        sb.Append(Trasfer(ckb01));
        sb.Append(Trasfer(ckb02));
        sb.Append(Trasfer(ckb03));
        sb.Append(Trasfer(ckb04));
        sb.Append(Trasfer(ckb05));
        sb.Append(Trasfer(ckb06));
        sb.Append(Trasfer(ckb07));
        sb.Append(Trasfer(ckb08));
        sb.Append(Trasfer(ckb09));
        sb.Append(Trasfer(ckb10));
        sb.Append(Trasfer(ckb11));
        sb.Append(Trasfer(ckb12));
        sb.Append(Trasfer(ckb13));
        return sb.ToString();
    }
    private void OpenNewWin(string path, string customerName)
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(JavascriptUtil.WrapperScript("window.open (\"" + path + "\", \"" + customerName + "\", \"width=800,toolbar=no,resizable=yes,scrollbars=yes\");"));
        ScriptManager.RegisterClientScriptBlock(lblMsg, lblMsg.GetType(), "js", sb.ToString(), false);
    }
    private void LocationHref(string path)
    {
        StringBuilder sb = new StringBuilder();
        sb.Append(JavascriptUtil.WrapperScript("location.href='"+path+"'"));
        ScriptManager.RegisterClientScriptBlock(lblMsg, lblMsg.GetType(), "js", sb.ToString(), false);
    }
    private string Trasfer(CheckBox ckb)
    {
        if (ckb.Checked) return "1"; else return "0";
    }
}
